﻿using System;
using System.Linq;
using System.ServiceModel;
using System.Threading;
using ClientTesting.ServiceReference1;

namespace ClientTesting
{
    class Program
    {
        static ServiceReference1.IService1Callback callback = new CallbackHandler();
        static InstanceContext context = new InstanceContext(callback);
        static Service1Client context1 = new Service1Client(context);
        static void Main(string[] args)
        {
            Timer t = new Timer(ComputeBoundOp, 5, 0, 2000);
            Console.WriteLine("Main thread: Doing other work here...");
           

            Console.ReadLine();
          
        }
  
        private static void ComputeBoundOp(object state)
        {
            context1.ping(1);
        }
    }
    class CallbackHandler :ServiceReference1.IService1Callback
    {
        public void Equals(string result)
        {
            // TODO: Implement this method
            Console.WriteLine("Equals called: " + result);
        }

        public void message(string eqn)
        {
            // TODO: Implement this method
            Console.WriteLine("Equation called: " + eqn);
        }

    }
   
}
